package com.kfm.am;

import java.util.HashMap;

public class China {

    private String city = "北京";
    private static double area = 960.1;

    public class GanSu {
        private String city;
        private static double area = 62.3;

        public GanSu(String city) {
            this.city = city;
//            HashMap
        }

        public void test() {
            System.out.println("GanSu--test()");
        }

        public static void test02() {
            System.out.println("GanSu--static test02()");
        }

        // 内部类访问外部类的方法 内部类内部有和外部类重名的方法，会发生隐藏，可以通过 外部类.this.方法 调用外部类的实例方法
        public void test03() {
            test(); // GanSu--test()
            China.this.test(); // China--test()
            test02(); // GanSu--static test02()
            China.test02(); // China--static test02()
            System.out.println(city); //
            System.out.println(China.this.city); // 北京
            System.out.println(area); // 62.3
            System.out.println(China.area); // 960.1
        }
    }

    public void test() {
        System.out.println("China--test()");
    }

    public static void test02() {
        System.out.println("China--static test02()");
    }

    public void test03() {
        test();
        test02();
        GanSu ganSu = new GanSu("兰州");
        ganSu.test();
        GanSu.test02();
        System.out.println(city);
        System.out.println(area);
        System.out.println(ganSu.city);
        System.out.println(GanSu.area);
    }

}


class Test06 {
    public static void main(String[] args) {
        China china = new China();
        China.GanSu ganSu = china.new GanSu("兰州");
        ganSu.test03();
        china.test03();
    }
}
